﻿/***************************************************************************
//* Foxit Software Inc.
//* Copyright(C) 2005-2012, all rights reserved.
//*
//* The following code is copyrighted and contains proprietary information
//* and trade secrets of Foxit Software Inc.                                                      *
***************************************************************************/

/**
* 菜单类
*/
define(function (require, exports, module) {
    var WebPDF = require('./WebPDF');
    WebPDF.CMenuItem = function (menuItemDefinition) {
        this.name = menuItemDefinition.name;
        this.onShowFunc = menuItemDefinition.onShow;
        this.onSelectFunc = menuItemDefinition.onSelect;
        this.createHtmlContentFunc = menuItemDefinition.createHtml;
        var _self = this;

        this.createHtml = function () {
            return _self.createHtmlContentFunc.call(this);
        };

        this.onShow = function (jqMenuItem) {
            if (this.onShowFunc != null) {
                _self.onShowFunc.call(this, jqMenuItem);
            }
        };

        this.onSelect = function (jqMenuItem) {
            if (this.onSelectFunc != null) {
                _self.onSelectFunc.call(this, jqMenuItem);
            }
        };
    };
    return WebPDF.CMenuItem;
});